package moon.voice.voiceTranslationHandler.voiceOutPut.Impl;

//import com.sun.speech.freetts.Voice;
//import com.sun.speech.freetts.VoiceManager;
//import com.sun.speech.freetts.audio.AudioPlayer;

public class VoiceEnglishHandler {

    /**
     *   FreeTTS 实现
     * @param text
     */
    public void FreeSpeakEnglish(String text){

//        System.setProperty("freetts.voices", "com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory");
//        VoiceManager vm = VoiceManager.getInstance();
//        Voice voice = vm.getVoice("kevin16");
//        if (voice != null) {
//            voice.allocate();
//            //Hello, this is FreeTTS running on JDK 1.8.Hello, this is FreeTTS running on JDK 1.8.
//            AudioPlayer audioPlayer = voice.getAudioPlayer();
//            voice.speak("river moon is big ");
//
//            voice.deallocate();
//        } else {
//            System.err.println("Voice not found.");
//        }

    }

}
